this._spacing = 20;
this._layoutFrozen = false;
+ this._metaWorkspace = metaWorkspace;
this._monitorIndex = monitorIndex;
this._workarea = metaWorkspace
? metaWorkspace.get_work_area_for_monitor(this._monitorIndex)
});
this._stateAdjustment.connect('notify::value', () => {
- [...this._windows.keys()].forEach(
- preview => this._syncOverlay(preview));
+ this.syncOverlays();
this.layout_changed();
});
}
}
_syncOverlay(preview) {
- preview.overlay_enabled = this._stateAdjustment.value === 1;
+ const active = this._metaWorkspace?.active ?? true;
+ preview.overlayEnabled = active && this._stateAdjustment.value === 1;
+ }
+
+ /**
+ * syncOverlays:
+ *
+ * Synchronizes the overlay state of all window previews.
+ */
+ syncOverlays() {
+ [...this._windows.keys()].forEach(preview => this._syncOverlay(preview));
}
/**
});
this.metaWorkspace = metaWorkspace;
+ this._activeWorkspaceChangedId =
+ this.metaWorkspace?.connect('notify::active', () => {
+ this.layoutManager.syncOverlays();
+ });
this._overviewAdjustment = overviewAdjustment;
this.monitorIndex = monitorIndex;
if (this.metaWorkspace) {
this.metaWorkspace.disconnect(this._windowAddedId);
this.metaWorkspace.disconnect(this._windowRemovedId);
+ this.metaWorkspace.disconnect(this._activeWorkspaceChangedId);
}
global.display.disconnect(this._windowEnteredMonitorId);
global.display.disconnect(this._windowLeftMonitorId);